With Recursive
具体例
code:fib.sql
with recursive fibb(x,y) as (
select 0,1
union
select y,x+y from fibb
limit 100
)
select x from fibb;
code:euclid.sql
with recursive euclid(x,y) as (
select 56,12
union all
select y, x%y from euclid
where y != 0
)
select x from euclid
where y = 0;